copy object in javascript without changing the parent object